const app = {
  state: {
    language: sessionStorage.getItem('language') || 'zh'
  },
  mutations: {
    setLanguage: (state, language) => {
      state.language = language
      sessionStorage.setItem('language', language)
    }
  },
  actions: {
    setLanguage ({commit}, language) {
      commit('setLanguage', language)
    }
  }
}

export default app
